package com.ctrip.cap.domain.benchmark;

public class TrafficInfo extends GeneralInfo{
	
	public TrafficInfo diff(TrafficInfo info)
	{
		TrafficInfo result=new TrafficInfo();
		result.setReceiveBytes(this.receiveBytes-info.getReceiveBytes());
		result.setSendBytes(sendBytes-info.getSendBytes());
		result.generateTotal();
		return result;
	}
	public void generateSpeed(double inteval)
	{
		receiveBytes/=inteval;
		sendBytes/=inteval;
		total/=inteval;
	}
	public TrafficInfo()
	{
		sendBytes=0;
		receiveBytes=0;
		total=0;
	}
	 
	public long getSendBytes() {
		return sendBytes;
	}
	public void setSendBytes(long sendBytes) {
		this.sendBytes = sendBytes;
	}
	public long getReceiveBytes() {
		return receiveBytes;
	}
	public void setReceiveBytes(long receiveBytes) {
		this.receiveBytes = receiveBytes;
	}
	public void addReceiveBytes(long receiveBytes) {
		this.receiveBytes += receiveBytes;
	}
	public void addSendBytes(long sendBytes) {
		this.sendBytes += sendBytes;
	}
	public long getTotal() {
		return total;
	}
	public void setTotal(long total) {
		this.total = total;
	}
	public void generateTotal()
	{
		total=this.receiveBytes+this.sendBytes;
	}
	public long getJobId() {
		return jobId;
	}
	public void setJobId(long jobId) {
		this.jobId = jobId;
	}
	private long jobId;
	private long sendBytes;
	private long receiveBytes;
	private long total;

}
